package com.xxzb.pack0720;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;

public class Test1 {
    public static void main(String[] args) throws Exception{
        //注册驱动
        Class.forName("com.mysql.jdbc.Driver");
        //获取链接
        String url="jdbc:mysql:///gaofeng2207?useSSL=false";
        String username="root";
        String password="1234";
        Connection conn= DriverManager.getConnection(url,username,password);
        //定义SQL语句
        String sql="update gaofeng2207.card set password=replace(replace(PassWord,'o','0'),'i','1')";
        //获取执行SQL语句的prepareStatement对象
        PreparedStatement ps=conn.prepareStatement(sql);
        ps.executeUpdate();
        //关闭语句
        ps.close();
        conn.close();


    }
}
